stage.set_background("schoolentrance")
sprite = codesters.Sprite("person10")
sprite.go_to(-125, -100)
emma = codesters.Sprite("person8")
emma.move_down(125)
emma.say("Someone took my phone!")
try:
tval1 = stage.get_wait_time()
except:
tval1 = "DNE"
try:
tval2 = emma.get_say_text().lower().replace(' ', '')
except:
tval2 = "DNE"
t1 = TestObjective()
t1.add_success(tval1 == 2, "Great job!")
t1.add_failure(tval1 == 0, "Did you add a wait command?")
t1.add_creative(tval1 != 2 and tval1 != 0, "That's a good wait time too!")
t2 = TestObjective()
t2.add_success('iamasprite' in tval2, "Great job!")
t2.add_failure(tval2 == "DNE", "Did you change the name in front of the say command to emma?")
t2.add_failure('tookmyphone' in tval2, "Did you add a new say command for emma?")
t2.add_creative('iamasprite' not in tval2 and tval2 != "DNE" and 'tookmyphone' not in tval2, "Creative choice!")
tester = TestManager()
tester.add_test_list([t1, t2])
tester.run_tests()
tester.display_first_feedback()
-
Run Code
-
Activity Submitted!
Submit Work
-
Next Activity
-
Stop Running Code
-
Show Chart
-
Show Console
-
Reset Code Editor
-
Codesters How To (opens in a new tab)